<%-- 
    Document   : viewOrders
    Created on : May 6, 2013, 12:18:42 AM
    Author     : Vitalii D.
--%>

<%@page import="com.charlie.beans.ShipmentOrder"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>

<style>
    .btn {
        background: linear-gradient(top, #b5bdc8 0%, #828c95 36%, #28343b 100%);
        border-radius: 5px;
    }
</style>

<%@include file="/header.jsp" %>

<div style="width: 25%; float: left;">
    <jsp:include page="/blocks/conditionalLeftBar.jsp" />
</div>

<div style="width: 74%; float: right;">
    <h2 class="content_title" style="font-family: Tahoma; font-size: 20pt">View orders</h2>
    <div class="white_block" overflow="scroll"> 
        
         <%
        List<ShipmentOrder> orders_list = (List<ShipmentOrder>) getServletContext().getAttribute("orderList");
        if (orders_list != null) {
        %>
        
        <h2 style="font-family: Arial; font-size: 18pt;color: #404040; text-align: center; font-weight: 400">Select the order you want to deliver</h2>
        <table class="cart_table">
           <colgroup>
               <col span="1" style="width: 20%;">
               <col span="1" style="width: 10%;">
               <col span="1" style="width: 25%;">
               <col span="1" style="width: 30%">
               <col span="1" style="width: 15%;">
           </colgroup>
           <thead>
               <tr>
                   <td class="cart_header_border" style="text-align: center;">creation date</td>
                   <td class="cart_header_border">tracking number</td>
                   <td class="cart_header_border" style="text-align: center">user e-mail</td>
                   <td class="cart_header_border" style="text-align: center">location</td>
                   <td></td>
               </tr>
           </thead>
           <tbody>
            <%
                for (ShipmentOrder item : orders_list) {%>
            <tr>
                <td>
                    <%SimpleDateFormat format = new SimpleDateFormat("MMM dd,yyyy");%>
                    <%=format.format(item.getCreationDate())%>
                </td>
                <td>
                    <!-- <%=item.getLocation()%>-->
                </td>
                <td>
                    <%=item.getEmail()%>
                </td>
                <td>
                    <%=item.getLocation()%>
                </td> 
            </tr>
            <%}
                } else {
                    out.print("<h1>No orders</h1>");
                }
            %>
        </tbody>
       </table>   
    </div>  
</div>
        
<jsp:include page="/blocks/pages.jsp">
    <jsp:param name="path" value="courier/OrdersForCourier" />
</jsp:include>
    
<%@include file="/footer.jsp" %>
